package behavior.state;

//发奖
public class DispenseState extends State {

    public DispenseState(Activity activity) {
        super(activity);
    }

    @Override
    void dispensePrize() {
        if(activity.getPrizeCount()>0){
            System.out.println("恭喜你 成功领取奖品");
            activity.setState(new NoRaffleState(activity));
        }else {
            System.out.println("很遗憾 奖品没有了");
            activity.setState(new DispenseOutState(activity));
        }
    }
}
